package com.qf.service;

import com.qf.dao.UserDao;
import com.qf.dao.UserDaoImpl1;
import com.qf.dao.UserDaoImpl2;
import com.qf.pojo.User;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package com.qf.service
 * @Description: UserService的第二个实现类
 * @Date 2022/6/2 10:08
 */
public class UserServiceImpl2 implements UserService{

    //声明UserDao接口属性 ,这个对象由spring进行实例化, 并注入进来, 也就是赋值进来
    private UserDao userDao;

    //属性的get方法
    public UserDao getUserDao() {
        return userDao;
    }

    //属性的set方法
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public UserServiceImpl2() {
    }

    public UserServiceImpl2(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void registUser() {
        userDao.insertUser();
        System.out.println("======UserService 的第二种实现类======");
    }

    @Override
    public List<User> findUserAll() {
        System.out.println("======UserServiceImpl2执行了findUserAll方法=======");
        return new ArrayList<User>();
    }

    @Override
    public void insertUser(User user) {
        System.out.println("======UserServiceImpl2执行了insertUser方法=======");
    }

    @Override
    public void updateUser(User user) {
        System.out.println("======UserServiceImpl2执行了updateUser方法=======");
    }

    @Override
    public void deleteUser(Integer id) {
        System.out.println("======UserServiceImpl2执行了deleteUser方法=======");
    }
}
